package com.bawei.mall.product.service.impl;

import com.bawei.common.security.utils.SecurityUtils;
import com.bawei.mall.product.domain.MallProductFoot;
import com.bawei.mall.product.mapper.MallProductFootMapper;
import com.bawei.mall.product.service.IMallProductFootService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author：作者姓名
 * @Package：com.bawei.mall.product.service.impl
 * @Project：mall_cloud
 * @name：IMallProductFootimpl
 * @Date：2024/7/3 14:45
 */
@Service
public class IMallProductFootServiceimpl implements IMallProductFootService {

    @Autowired
    private MallProductFootMapper mallProductFootMapper;




    @Override
    public List<MallProductFoot> selectMallProductFoot() {
        return mallProductFootMapper.selectMallProductFoot();
    }

    @Override
    public void deleteAllMallProductFoot() {
        mallProductFootMapper.deleteAllMallProductFoot();
    }

    @Override
    public void insertMallProductFoot(MallProductFoot mallProductFoot) {
        Long userId = SecurityUtils.getUserId();
        Integer productId = mallProductFoot.getProductId();
        mallProductFootMapper.insertMallProductFoot(productId,userId);
    }
}
